package org.krishna.model;



import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "TRANSACTION")
public class TransactionDetails implements Serializable{
	
	/** The Constant serialVersionUID. */
	@Transient
	private static final long serialVersionUID = -7660824605183781430L;
	
	
	@Id
	@GeneratedValue
	@Column(name = "TRANS_ID")
	private long transId;

	@Column(name = "TYPE")
	private String type;
		
	@Column(name = "TRANS_DATE")
	private Date transactionDate;	
	
	@Column(name = "FINE")
	private int fine;

	@ManyToOne
	@JoinColumn(name = "USER_ID")
	private UserDetails userDetails;
	
	@ManyToOne
	@JoinColumn(name = "BOOK_ID")
	private BookDetails bookDetails;

	/**
	 * @return the transId
	 */
	public long getTransId() {
		return transId;
	}

	/**
	 * @param transId the transId to set
	 */
	public void setTransId(long transId) {
		this.transId = transId;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * @return the transactionDate
	 */
	public Date getTransactionDate() {
		return transactionDate;
	}

	/**
	 * @param transactionDate the transactionDate to set
	 */
	public void setTransactionDate(Date transactionDate) {
		this.transactionDate = transactionDate;
	}

	/**
	 * @return the fine
	 */
	public int getFine() {
		return fine;
	}

	/**
	 * @param fine the fine to set
	 */
	public void setFine(int fine) {
		this.fine = fine;
	}

	/**
	 * @return the userDetails
	 */
	public UserDetails getUserDetails() {
		return userDetails;
	}

	/**
	 * @param userDetails the userDetails to set
	 */
	public void setUserDetails(UserDetails userDetails) {
		this.userDetails = userDetails;
	}

	/**
	 * @return the bookDetails
	 */
	public BookDetails getBookDetails() {
		return bookDetails;
	}

	/**
	 * @param bookDetails the bookDetails to set
	 */
	public void setBookDetails(BookDetails bookDetails) {
		this.bookDetails = bookDetails;
	}		
}
